<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<div class="row">
    <div class="col-lg-12">
        <div class="panel">
            <div class="panel-heading">
                <h3 class="panel-title">工作日志登记表</h3>
            </div>

            <!-- BASIC FORM ELEMENTS -->
            <!--===================================================-->
            <form id="form_worklog_input" class="panel-body form-horizontal form-padding">
                <input type="hidden" name="keyId" id="keyId" value="${worklog.id}" />

                <div class="form-group div-Hidden">
                    <label class="col-md-2 control-label">时间<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                            <div class="input-group date">
                                <input type="text" class="form-control" id="datWorklog" name="datWorklog" disabled
                                value=<fmt:formatDate pattern="yyyy-MM-dd" value="${worklog.datWorklog}" /> >
                                <span class="input-group-addon"><i class="ti-calendar"></i></span>
                            </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">日志名称<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="text" id="name" name="name" class="form-control" value="${worklog.name}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">工作日志内容<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="text" id="content" name="content" class="form-control" disabled value="${worklog.content}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">文件附件</label>
                    <div class="col-md-6">
                        <input name="hiddenFiles" id="hiddenFilesAttachment" type="hidden" value="${worklog.fileAttachment}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">提交人</label>
                    <div class="col-md-2">
                        <p class="form-control-static">${worklog.creater.name}</p>
                    </div>
                    <label class="col-md-2 control-label">提交日期</label>
                    <div class="col-md-2">
                        <p class="form-control-static"><fmt:formatDate pattern="yyyy-MM-dd" value="${worklog.dateApply}" /></p>
                    </div>
                </div>
            </form>
            <!--===================================================-->
            <!-- END BASIC FORM ELEMENTS -->

            <div class="panel-footer">
                <a class="btn btn-default" id="apply-re-common" href="javascript:void(0)">
                    <i class="fa fa-lg fa-mail-reply"></i> 返回视图
                </a>
                <c:if test="${worklog.numStatus==0 && user.id==worklog.creater.id}">
                    <a class="btn btn-warning" key="ajax_worklog_edit" href="javascript:void(0);"><i class="fa fa-lg fa-edit"></i> 编辑表单 </a>
                </c:if>
            </div>
        </div>
    </div>
</div>

<script>

    // 附件显示
    readLoad({
        objId:"hiddenFilesAttachment",
        entityName:"fileAttachment",
        sourceId:"hiddenFilesAttachment"
    });

    //编辑
    $("a[key='ajax_worklog_edit']").unbind("click").bind("click",function(){
        loadURL("<%=path%>/activiti/worklog/edit/"+$("#keyId").val(),$('#page-content'));
    });

    //返回视图
    $("#apply-re-common").click(returnToHashUrl);

    // 加载完成后执行
    $(function(){

    })

</script>




